import { createRouter, createWebHistory } from 'vue-router';
import Home from './views/home/index.vue';
import Login from './views/login/index.vue';
import Layout from '@/components/Layout/index.vue';
import buyerRegister from './views/buyerRegister/index.vue';
import buyerCenter from './views/buyerCenter/index.vue';

const routes = [
	{
		path: '/login',
		name: 'login',
		component: Login,
	},
	{
		path: '/',
		name: 'home',
		component: Layout,
		redirect: '/home',
		children: [
			{
				path: '/home',
				name: 'Home',
				component: Home,
			},
			{
				path: '/buyerRegister',
				name: 'buyerRegister',
				component: buyerRegister,
			},
			{
				path: '/buyerCenter',
				name: 'buyerCenter',
				component: buyerCenter,
			},
		],
	},
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
